package com.slicktechnologies.client.utility;
//package ;
import com.simplesoftwares.client.library.appskeleton.AbstractScreen;
import com.simplesoftwares.client.library.appskeleton.AppMemory;
import com.simplesoftwares.client.library.appstructure.formtablescreen.FormTableScreen;
import com.slicktechnologies.client.config.configurations.ConfigForm;
import com.slicktechnologies.client.config.configurations.ConfigPresenter;
import com.slicktechnologies.client.config.configurations.ConfigTabels;
import com.slicktechnologies.client.config.typeconfig.TypePresenter;
import com.slicktechnologies.client.registration.RegistrationPresenter;
import com.slicktechnologies.client.views.account.expensemanagment.ExpensemanagmentPresenter;
import com.slicktechnologies.client.views.contract.ContractPresenter;
import com.slicktechnologies.client.views.customer.CustomerPresenter;
import com.slicktechnologies.client.views.home.HomePresenter;
import com.slicktechnologies.client.views.servicetype.ServiceTypePresenter;
import com.slicktechnologies.client.views.settings.branch.BranchPresenter;
import com.slicktechnologies.client.views.settings.company.CompanyPresenter;
import com.slicktechnologies.client.views.settings.employee.EmployeePresenter;
import com.slicktechnologies.client.views.settings.user.UserPresenter;
import com.slicktechnologies.shared.common.helperlayer.Config;

/**
 * Enum for ConfigTypes. Abstracts the screen.
 * @author Kamala
 *
 */
public enum Screen implements AbstractScreen
{
	CUSTOMER, CONTRACT, CATEGORY, BRAND, CUSTOMERPARTICULARS, SERVICETYPE, HOME, REGISTRATION, EMPLOYEE, USER, EXPENSEMANAGMENT, COMPANY, EXPENSEGROUP, EXPENSECATEGORY, EXPENSETYPE, COMPANYTYPE, CURRENCY, PAYMENTTERMS, 
	PAYMENTMETHODS, BRANCH, EMPLOYEETYPE, EMPLOYEEDESIGNATION;
	//Token to add the project specific screens






	AppMemory mem;


	/*
	 * Method template to  switch the screens
	 */
	@SuppressWarnings("incomplete-switch")
	@Override
	public void changeScreen() 
	{
		Screen s= (Screen) AppMemory.getAppMemory().currentScreen;

		switch(s)
		{

		case CUSTOMER:
			CustomerPresenter.initalize();
			break;


		case CONTRACT:
			ContractPresenter.initalize();
			break;


		case COMPANY:
			CompanyPresenter.initalize();
			break;

		case SERVICETYPE:
			ServiceTypePresenter.initalize();
			break;

		case EXPENSEMANAGMENT:
			ExpensemanagmentPresenter.initalize();
            break;





		case BRANCH:
			BranchPresenter.initalize();
			break;
		case EMPLOYEE:
			EmployeePresenter.initalize();
			break;
		case USER:
			UserPresenter.initalize();
			break;
	

		case HOME:
			HomePresenter.initalize();
			break;

		


		case REGISTRATION:
			RegistrationPresenter.initalize();
			break;


		case COMPANYTYPE:
		case PAYMENTMETHODS:
		case PAYMENTTERMS:
		case CURRENCY:
		case EXPENSEGROUP:
		case BRAND:
		case CATEGORY:
		case CUSTOMERPARTICULARS:
		configscreenswitchcase();
		break;
		case   EXPENSECATEGORY:
		
			com.slicktechnologies.client.config.categoryconfig.CategoryPresenter.initalize();
			break;
		
		case EXPENSETYPE:
			TypePresenter.initalize();

		}

	}

	@SuppressWarnings("unused")
	private void configscreenswitchcase()
	{
		ConfigTabels table=new ConfigTabels();
		ConfigForm form=new ConfigForm(table, FormTableScreen.UPPER_MODE, true);
		ConfigPresenter p=new ConfigPresenter(form, new Config());
		AppMemory.getAppMemory().stickPnel(form);

	}



}
